/**
 * Created by jean.h.ma on 14/03/2018.
 */

import React from 'react'
import Base from '@codefree/badger/app/components/Base'
import Layout from '@codefree/badger/app/components/Layout'
import Navigation from './Navigation'
import SlideMenu from './SlideMenu'
import menus from '../config/slideMenus'
import {connect} from 'react-redux'

@connect(({state: {showSlideMenu}}) => ({
	showSlideMenu
}))
export default class Master extends Base {
	render() {
		return (
			<Layout>
				<div className="badger-master">
					<div className="master-top" style={{height: 82}}>
						<Navigation/>
					</div>
					<div className="master-middle">
						<div className="master-middle-left" style={this.props.showSlideMenu ? {} : {width: 0}}>
							<SlideMenu menus={menus}/>
						</div>
						<div className="master-middle-content">
							{this.props.children}
						</div>
					</div>
				</div>
			</Layout>
		);
	}
}